package com.itheima;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class Test7 {
    public static void main(String[] args) {
        int[] nums = {3,2,3};
        HashMap<Integer,Integer> hs = new HashMap<>();
        for(int i  = 0;i<nums.length;i++){
            if(hs.containsKey(nums[i])){
                int value = hs.get(nums[i]);
                value++;
                hs.put(nums[i],value);
            }else{
                hs.put(nums[i],1);
            }
        }
        Set<Map.Entry<Integer, Integer>> entries = hs.entrySet();
        for (Map.Entry<Integer, Integer> entry : entries) {
            Integer num = entry.getValue();
            if(num>(nums.length/2)){
                System.out.println(entry.getKey());
            }
        }
    }
}
